﻿@{ 
    Page.Title = "NuGet Docs | Page Not Found";
    PageData["NoSearch"] = true;
    var errorPath = Request.QueryString["aspxerrorpath"];

    if(String.IsNullOrEmpty(errorPath)){
        errorPath = Request.RawUrl;
    }
    
    errorPath = Path.GetFileNameWithoutExtension(errorPath).Replace("-", " ");
}

<div class="error-show-code"></div>
<div class="error-page">
    <h1>404 : Page Not Found</h1>
    <p>You might be here because:</p>
    <ul>
        <li>The page you are looking for does not exist anymore.</li>
        <li>We moved the page that you are looking for, sorry!</li>
        <li>You know how to hack URLs and you're trying to find something.</li>
        <li>We just plain suck and messed something up.</li>
    </ul>

    <h2 class="search">Try Searching</h2>
    <form action="" onsubmit="return submitQuery()">
        <input name="q" id="searchBoxInput" value="@errorPath" placeholder="Search Docs" />
        <input id="searchBoxSubmit" type="submit" value=" " />
    </form>

    <h2>Still Nothing?</h2>
    <ul>
        <li>File a bug so we can fix it. <a href="http://nugetdocs.codeplex.com/WorkItem/Create">http://NuGetDocs.CodePlex.com</a></li>
        <li>Fix the issues yourself by contributing to NuGet Docs. <a href="@Href("~/docs/Contribute/Contributing-to-NuGet-Documentation")">Contributing to NuGet Documentation</a></li>
    </ul>
</div>

<script type="text/javascript">
    function submitQuery() {
        window.location =  "@Href("~/search")?q="
        + encodeURIComponent($("#searchBoxInput").val());
        return false;
    }
</script>